<?php
	if(empty($uid)) die();
    $num_pid = db_count('user_pay',array('uid'=>$uid));
	$page = param(2,1);
	$data =  db_find('user_pay',array('uid'=>$uid), array('time'=>-1), $page, $pagesize = 20);
	$pagination = pagination(url("my-record-{page}"), $num_pid, $page, $pagesize);
function subject($tid)
{$r = db_find_one('thread',array("tid"=>$tid));return $r['subject'];}
?>
<template include="./plugin/tt_credits/view/htm/my_credits.template.htm">
	<slot name="my_body"><table class="table"><tr><th>时间</th><th>类型</th><th>积分</th><th>记录</th></tr>
		<?php foreach($data as $v) {$c_type = $v['credit_type'];?><tr>
			<td><?php echo date('Y-m-d H:i:s',$v['time']); ?></td><td><?php echo $g_credits_type_array[$v['type']];?>,<?php echo $g_credits_status_array[$v['status']+1];?></td><td><?php if($v['num']>0) {echo $c_type=='3'?$v['num']/100.0:$v['num'],' '.$c_type<=3?lang('credits'.$c_type):'';}else{echo '-';} ?></td><td><?php echo $v['code'];?></td>
			</tr>
		<?php }?></table>
		<nav class="text-center"><ul class="pagination"><?php echo $pagination; ?></ul></nav>
	</slot>
</template>
<script>
    $('a[data-active="my-record"]').addClass('active');
</script>